Skip to content

fix(deps): exclude RELATES_TO edges from cycle detection#65

Merged
jpicklyk merged 1 commit intomainfrom
fix/relates-to-cycle-detection
Mar 8, 2026
Merged

fix(deps): exclude RELATES_TO edges from cycle detection#65
jpicklyk merged 1 commit intomainfrom
fix/relates-to-cycle-detection

Conversation

@jpicklyk
Copy link
Owner

@jpicklyk jpicklyk commented Mar 8, 2026

Summary

  • Bug fix: RELATES_TO (informational) dependency edges were incorrectly included in DFS cycle detection, causing false positive cycle rejections
  • Root cause: DFS filter dep.type != IS_BLOCKED_BY traversed RELATES_TO edges as if they were blocking; changed to dep.type == BLOCKS
  • Call-site guards: Added type != RELATES_TO checks at both create() and createBatch() call sites to skip cycle detection entirely for informational deps
  • TDD approach: 5 tests written first to prove the bug, then fix applied

Test Results

  • 28 DependencyRepository tests passing (5 new + 23 existing)
  • Full test suite: BUILD SUCCESSFUL, no regressions

Review

  • Independent review agent: PASS WITH OBSERVATIONS
  • Plan alignment confirmed (TDD: failing tests → fix → green)
  • /simplify pass: code is clean, no changes needed

MCP Items

  • 0afc3836 — Unify DependencyRepository sync/async API and fix cycle detection

🤖 Generated with Claude Code

RELATES_TO dependencies are purely informational and cannot create
blocking deadlocks. The DFS cycle detection was incorrectly traversing
RELATES_TO edges, causing false positive cycle rejections — e.g.,
creating B RELATES_TO A when A BLOCKS B existed would be rejected.

Three changes:
- DFS filter: `!= IS_BLOCKED_BY` → `== BLOCKS` (excludes RELATES_TO)
- insertDependencyInTransaction: skip cycle check for RELATES_TO
- createBatch: skip cycle check for RELATES_TO

Adds 5 TDD tests covering the fix and regression guards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jpicklyk jpicklyk merged commit 2d48c85 into main Mar 8, 2026
2 checks passed
@jpicklyk jpicklyk deleted the fix/relates-to-cycle-detection branch March 8, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant